<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>小米商城登录页面</title>
<link rel="stylesheet" type="text/css" href="css/loading.css">
<script type="text/javascript" src="js/jquery-1.12.4.js"></script>
<script type="text/javascript" src="js/loading.js"></script>
<script type="text/javascript" src="js/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="js/bgstretcher.js"></script>
<link rel="stylesheet" type="text/css" href="css/bgstretcher.css"></link>
</head>
<!-----------------------------主体部分------------------------>
<body>
	<div class="container">
		<!----------------------第一部分------------------->
		<div class="header_logo">
			<a href="index.jsp"><img src="img/mistore_logo.png"></a>
		</div>
		<!-------------------------第二部分----------------->
		<div class="content">
			<a href="mi8show.jsp" id="aaa"></a>
			<div class="content_form">
				<form class="formstyle" action="CustomerLoginAction" method="post"
					name="default_loginform" onsubmit="return validateForm()">
					<div id=logined>
						<a class="login" id="login_count">账号登录</a> <span class="line">|</span>
						<a class="login" id="login_code">扫码登录</a>
					</div>

					<div id="default_block">

						<div class="inputdata">
							<input type="text" id="textUsertel" name="customer_name"
								placeholder="邮箱/手机号/小米ID" />
						</div>
						<div class="inputdata">
							<input type="password" id="textUserPsw" name="customer_psw"
								placeholder="密码" />
						</div>

						<!--表单验证的提示信息部分-->
						<div class="form_hint">
							<span class="inputcount">请输入账号！</span> <span class="inputpwd">请输入密码！</span>
							<span class="reinput_count_pwd">账号或密码不正确！</span>
						</div>

						<div class="login_btn" style="cursor: pointer;">
							<input type="submit" name="submit" value="登录" class="denglu_btn" style="cursor: pointer;"/>
						</div>
						<div class="login_bottom">
							<!--<div class="login_bottom1">-->
							<a class="login" id="login_a1">手机短信登录/注册</a> <a class="login"
								id="login_a3" href="register.jsp">立即注册</a> <span class="line">|</span>
							<a class="login">忘记密码?</a>
							<!--</div>-->
						</div>

					</div>

					<!--扫码登录-->
					<div class="login_code_part">
						<img class="login_code_img" src="img/xiaomicode.png" /> <span
							class="login_code_font">使用</span> <span class="login_code_font"
							id="login_code_font">&nbsp;小米商城App&nbsp;</span> <span
							class="login_code_font">扫一扫</span>
						<p class="login_code_font">小米手机可打开【设置】>【小米账号】扫码登录</p>
					</div>
				</form>

				<!--点击手机短信登录登录显现的页面-->
				<div id="click_block">
					<form action="CodeLoadingAction" method="post"
						id="cover-login-form">
						<div class="inputdata">
							<div class="inputdata_86">+86</div>
							<div>
								<!-- 之前的name属性值：name="txtUsertel" -->
								<input type="text" id="textUsertel2" name="customer_tel"
									placeholder="手机号码" />
							</div>
						</div>
						<div class="inputdata">
							<div>
								<input type="text" id="textUserPsw2" name="txtUserPsw"
									placeholder="短信验证码" />
							</div>
							<div class="yzbtn" id="btn">
								获取验证码
								<!-- <input type="submit" name="submit" id="yzsub" value="" /> -->
							</div>
						</div>
						<div class="login_btn" style="cursor: pointer;">
							<input type="submit" name="submit" value="立即登录/注册"
								class="denglu_btn" id="log2_btn" onclick = "return doCodeCheck();" style="cursor: pointer;"/>
						</div>
						<div class="login_bottom">
							<div class="login_bottom1">
								<p class="login" id="login_a2">用户名密码登录</p>
							</div>
						</div>
					</form>
				</div>

				<!--其他登录-->
				<div class="other_login">
					<fieldset class="other_login_title">
						<legend align="center" class="other_type_txt">其他登录方式</legend>
					</fieldset>
					<div class="other_login_sub">
						<a class="other_login_logo logoimg1" name="qqlogin" style="">
							<i class="btn_icontype icon_default_qq"></i>
						</a> <a class="other_login_logo logoimg2" name="weibologin" style="">
							<i class="btn_icontype icon_default_weibo"></i>
						</a> <a class="other_login_logo logoimg3" name="zhifubaologin"
							style=""> <i class="btn_icontype icon_default_alipay"></i>
						</a> <a class="other_login_logo logoimg4" name="weixin" style="">
							<i class="btn_icontype icon_default_weixin"></i>
						</a>
					</div>
				</div>
			</div>

		</div>
		<!--------------------------------第三部分------------------>
		<div class="footer">
			<div id="footer-id1">
				<ul class="footer-ul1">
					<li><a href="">简体</a>&nbsp;&nbsp;|&nbsp;</li>
					<li><a href="">繁体</a>&nbsp;&nbsp;|&nbsp;</li>
					<li><a href="">English</a>&nbsp;&nbsp;|&nbsp;</li>
					<li><a href="">常见问题</a>&nbsp;&nbsp;|&nbsp;</li>
					<li><a href="">隐私政策</a></li>
				</ul>
			</div>
			<div id="footer-id2">
				<span>小米公司版权所有-京ICP备10046444-</span> <span><a href=""><img
						src="img/警徽logo.png" />京安网安备110108010134号</a></span> <span>-京ICP证110507号</span>
			</div>
		</div>
	</div>
	<script>
		var sms = "";
		$("#btn").click(function() {
			var phone = $("#textUsertel2").val();
			if (phone != "") {

				$.ajax({
					url : "TestMessage",
					type : "post",
					data : {
						"textUsertel2" : phone
					},
					success : function(result) {
						sms = result;
					}
				});
			} else {
				alert("请输入手机号");
				return false;
			}
		});

		
		/* function doCodeCheck(){
			var code = $("#textUserPsw2").val();
			var flag = false;
			if (code == "") {
				alert("请输入验证码");
			} else if (sms == code) {
				flag = true;
			}
			else {
				alert("验证码错误");
			};
			return flag;	
		} */
		
		 $("#log2_btn").click(function() {
			var code = $("#textUserPsw2").val();
			if (code == "") {
				alert("请输入验证码");
			} else if (sms == code) {
				window.location.href = "index.jsp";
			}
			else {
				alert("验证码错误");
			}; 
		});
	</script>
</body>
</html>